package com.example.springpostbody.controller;

import com.alibaba.fastjson2.JSON;
import com.example.springpostbody.model.vo.TestVo;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/test")
public class TestController {

    @PostMapping(value = "/post") //,produces = {"application/json;charset=UTF-8"}
    public Map<String,Object> test(@RequestBody TestVo vo){
        System.out.println("请求参数="+ JSON.toJSONString(vo));
        return Map.of("code",200, "msg","成功");
    }

    @GetMapping("get")
    public Map<String,Object> test1(){
        return Map.of("code",200, "msg","成功");
    }
}
